﻿CREATE PROCEDURE [dbo].[ETL_SP_GetDataTableDataHistoryList]
	@DtTableId uniqueidentifier,
	@DataId nvarchar(512),
	@ColumnName nvarchar(64)
AS
	SELECT H.*,
		DTC.Name as ColumnName
	FROM ETL_DtTableDataHistory as H
		INNER JOIN ETL_DtTableColumn as DTC on DTC.DtTableId = H.DtTableId and DTC.Id = H.ColumnId
	WHERE H.DtTableId = @DtTableId and H.DataId=@DataId and DTC.Name=@ColumnName
RETURN 0